Electro-convulsive therapy (ECT) system with enhanced safety features

ABSTRACT

An electro-convulsive therapy (ECT) system includes both hardware and software safety detectors and monitors, including a pulse generator that generates a pulse train of a plurality of pulses with parameters specified by the user. The safety monitors monitor these user-specified parameters as well as other important pulse parameters both during treatment of a patient and prior to treatment in order to ensure that the system is operating according to specification and, therefore, will not injure the patient. The pulse generator is responsive to the safety monitors in that if any of the safety detectors detect a parameter that is out of tolerance, the safety monitor disables the pulse generator so that no further pulses are delivered to the patient. The safety detectors detect plurality of pulse characteristics including pulse width, frequency, voltage, current, treatment duration, as well as energy. In addition to these real time safety checks, the system includes a pre-treatment arming routine that applies a pre-treatment ECT pulse train to an internal load and monitors these same parameters during this internal test. If all of these parameters are within tolerance, the system moves to an armed state in which the user can proceed to apply an ECT treatment pulse train. If any one of these safety checks fails, however, the system does not arm and, therefore, prohibits treatment.

This is a continuation of application Ser. No. 08/562,336, filed Nov.24, 1995 now abandoned.

BACKGROUND OF THE INVENTION

In the early portions of the Twentieth Century, there was a greatfeeling of desperation within the mental health community. Mental healthhospitals were filled with thousands upon thousands of severely andchronically ill individuals, predominantly schizophrenic, for whom therewere no viable means of therapy. Acting upon some erroneous data whichindicated that there appeared to be an antagonism between schizophreniaand epilepsy, the Hungarian neuropsychiatrist, Meduna, attempted toinduce seizures in schizophrenics by injecting oil of camphorintramuscularly. Within a year following his initial successful reportof such use in the management of schizophrenia in 1935, news of the useof induced seizures for such a purpose spread around the world. A long,hoped for breakthrough had now occurred.

Producing seizures with the use of camphor, however, was by no means apleasant or even reliable task. Even though camphor was almostimmediately replaced by a pure pharmacologic preparation,pentylenetetrazol (or Metrazol), the use of this technique was stillhampered by the presence of painful myoclonic contractions occurringprior to seizure onset. Occasionally, difficulty in inducing seizures atall, lack of predictability when the seizure would occur, and thepossible presence of prolonged and recurrent seizure activity. Still,the therapeutic benefits of pharmacoconvulsive therapy, as it wascalled, clearly appeared to outweigh the difficulties.

Among those who were impressed by the early successes ofpentylenetetrazolinduced seizures was the Italian neuropsychiatrist,Cerletti, who was at that time heavily involved in epilepsy research,using electrical stimulation to produce seizures in animals. Believingthat therapeutic seizures in humans could be produced more easily and ina manner more tolerable to patients, Cerletti and his colleague, Bini,attempted to use their techniques clinically in 1937. The success oftheir initial report of such use in 1938 was heralded by psychiatristsas a significant improvement in the form of convulsive technique, andwithin one or two years had spread into clinical practice on a worldwidebasis.

During the 1940's and throughout much of the 1950's electro-convulsivetherapy (ECT) was a mainstay of psychiatric management of severe mentalhealth disorders. As with any powerful new form of treatment, it wasused on an extremely widespread basis. Over the course of this period ofits use, it became clear that while ECT was occasionally useful attreating schizophrenia, its effects were even more beneficial in themanagement of severe affective disorders, particularly major depressiveepisodes. With the development of effective psychotropic alternativesfor treating schizophrenia and affective disorders, beginning in themid-1950's, the use of ECT began to decline.

At present, ECT is used sparingly. It is estimated that in the U.S.,only three to five percent of psychiatric in-patients receive thistreatment modally, and that between 30,000 to 100,000 patients per yearare involved. Many psychiatrists believe that the decline in ECTutilization has now reached a turning point, in that there now appearsto be a growing acceptance of its continual clinical role with respectto available therapeutic alternatives. Until the day comes when moreeffective and less toxic drugs or procedures become available, it islikely that ECT will continue to be used.

In their initial use of ECT, Cerletti and Bini were quite uncertain andapprehensive as to the proper means of stimulus dosage. Consequently,the first ECT machine was a rather complicated, ornate-appearing device,with numerous dials, buttons and controls. The type of electrical signalutilized by Cerletti and Bini was the sine wave, which is what ispresent in electrical sockets in homes and offices. As one would expect,this type of stimulus waveform was utilized because of its readyavailability. If one looks on an oscilloscope, the household sine waverepresents an undulating pattern of voltage or current, varying withtime and repeating fifty to sixty times a second depending on thecountry.

Following the initial reports of actual stimulus parameters required toinduce a seizure, in the absence of data pointing toward any directelectrical damage upon the organisms from such dosage levels, there wasa drift among ECT device manufacturers to simpler and simpler devices.In some settings, this resulted in the use of stimulus electrodes whichwere plugged directly into a wall socket. In most cases, however, atleast the presence of an "ON" button, along with a control forincreasing or decreasing voltage or current, was present.

The early discovery that induced seizures were associated with confusionand amnesia, however, led researchers to try and experiment with thenature of electrical stimulus, under the assumption that moreenergy-efficient stimuli might have less detrimental side effects. Bythe mid- 1940's, Lieberson and colleagues had found that an interruptedstimulus pattern, consisting of brief, rapidly rising and falling pulsesof electricity, separated by longer periods of electrical inactivity,offered the promise of producing seizures on a more efficient basis withseemingly less confusion and amnesia. Unfortunately, most practicingpsychiatrists were either not aware of or were not impressed by thisdata. There was a feeling that the confusion and amnesia were eitherunimportant or perhaps even useful therapeutically. In addition, therewere severe methodological problems with their early studies, as therewere almost universally with investigations taking place during thistime period. Accordingly, the use of the sine wave stimulus, at least inthe U.S., continued to be extremely widespread into the 1970's.

In the mid-1970's the late psychiatrist and prominent ECT researcher,Paul Blachley, decided that, given the degree of concern over memorydeficits which had arisen during the ongoing controversy overunilaterally, nondominant versus bilateral electrode placement, anattempt should once more be made to offer an option of brief-pulsestimulus waveform with ECT devices. In addition, Blachley felt that this"optimal" device should also incorporate the capacity of monitoring bothEEG and ECG; and should offer the user a clear means to test the safetyof the electrical circuit before delivering the stimulus; and finally,that it should be able to offer the ability to allow careful titrationto individuals' seizure thresholds. After design and testing efforts,this device, which was known as the MECTA (Monitored Electro-ConvulsiveTherapy Apparatus) went on the market in 1977, and readily grew inpopularity over the following years.

Based on a number of developments in the research literature, andcomments and suggestions by psychiatrists using ECT devices, a newgeneration of MECTA devices was placed on the market. This newgeneration included the SR and JR models manufactured and sold by MECTACorporation, of Lake Oswego, Oreg. Although this new generation of ECTdevices was an improvement over existing devices in terms of safety,effectiveness and ease of use, there were still additional improvementsto be made in all of these areas.

The SR and JR models include two safety features. The first feature usesa "self-test." Despite its name, the "self test" does not test thedevice itself but instead measures the static patient impedance prior toapplication of an ECT stimulus. The clinician instigates this test bypushing a self-test button on the device after the ECT electrodes arepositioned on the patient. The ECT device then measures the impedancerunning from the ECT device through an ECT electrode, the patient, theother ECT electrode, and back to the device. During the self-test, thedevice passes a minute current through the circuit. These models measurethe impedance by measuring the voltage produced across the circuit anddividing that measured voltage by an assumed current level. Thecalculated static impedance is then compared to a predetermined range ofstatic impedances. If the calculated static impedance is within thatrange, the self-test passes. Otherwise, the self-test fails.

If the static patient impedance is outside the acceptable range, thedevice inhibits delivery of an ECT stimulus unless an "impedanceoverride" button is pressed. The impedance override button allowsclinicians to bypass the self-test failure and engage a stimulusdelivery sequence where the extreme static impedance value is due to apeculiar patient's characteristics.

The SR and JR models from MECTA also allow the clinician or othertechnician to verify that the device is operating within their specifiedtolerances. This is accomplished by connecting the stimulus output ofthe device to an external resistor substitution box, i.e., a "dummy"load. A stimulus sequence can then be applied to the dummy load and theresulting signal's characteristics can be measured with the use of anexternal oscilloscope whose leads are applied across the resistor dummyload. The clinician or technician can then compare the measured signalcharacteristics as displayed on the oscilloscope with the parametersettings specified by the dial settings on the device. In this way, thefrequency, pulse width, duration and energy specifications can beverified. If the device turns out to be out of range or out ofspecification, the device can then be returned to the manufacturer forrepair or recalibration.

Although the self-test and the calibration test are useful, they do notgo far enough. The main problem with both of these tests is that theyare conducted prior to the ECT treatment sequence and not during thetreatment itself. Thus, if one or more of the parameters (current,voltage, pulse width, frequency or duration) were to drift out of rangeduring an actual treatment, this condition would not be detected untilthe next calibration test. Moreover, the self-test checks only a singleparameter, i.e., static impedance, and none of the other parameterswhich determine the amount of energy actually delivered to the patient.

The MECTA SR and JR devices do display an estimated energy delivered tothe patient during treatment. This energy, however, is an estimate basedon several assumed parameter values. As is known in the art, energy is afunction of voltage, impedance, and time or duration. In the MECTAdevices, only the voltage and impedance are measured and the time orduration is assumed based upon the duration setting on the front panel.Thus, if the actual duration of the applied ECT treatment sequence isdifferent than that specified on the front panel, the estimated energywill not equal the actual delivered energy. As a result, the cliniciancan be misled as to the actual delivered energy.

Accordingly, a need remains for improved parameter monitoring both priorto and during ECT treatment.

SUMMARY OF THE INVENTION

It is, therefore, an object of the invention to improve the safety andreliability of ECT devices.

Another object of the invention is to automate the safety testprocedure.

A further object of the invention is to improve the quality of measuredpatient monitoring signals.

A yet further object of the invention is to provide an improved methodand apparatus for monitoring seizure activity.

The invention is an electro-convulsive therapy (ECT) system withadvanced safety features. The system includes a means for applying atrain of ECT treatment pulses to a patient, a plurality of pulse trainparameter detectors that each detect a respective pulse train parameter,and a corresponding plurality of pulse train parameter monitors thatdisable the applying means if the detected pulse train parameter fallsoutside of a predetermined range of acceptable values. The monitorsoperate on a pulse-by-pulse basis and, therefore, provide added safetyby terminating a treatment if any of the measured parameters are outsidetheir specified tolerances. This ensures that a safe and effectivetreatment is applied to the patients in the event a component or circuitfails or drifts out of calibration prior to or during treatment.

The system monitors all of the relevant pulse train signal parameters:voltage, current, pulse width, frequency, pulse train duration, andenergy. None of these parameters are assumed, but instead are actuallymeasured. In addition, several of the parameters are measured both bydedicated hardware as well as redundant software monitoring routines.This redundancy provides an additional level of safety heretofore notfound in ECT devices.

In another aspect of the invention, the system includes an internal loadto which a pre-treatment ECT pulse train can be applied during aninternal test. During this internal test, the system monitors all of thepulse train parameters and disables the applying means if a detectedparameter of a pre-treatment pulse train is outside the determinedrange. This includes voltage, current, pulse width, frequency, pulsetrain duration and energy, as with the actual ECT treatment pulse train.

In yet another aspect of the invention, a frequency adaptive finiteimpulse response (FIR) filter is described. The adaptive FIR filter isused to eliminate unwanted line frequency interference from patientmonitoring signals (e.g., EEG or ECG). The adaptive FIR filter includesmeans for calculating an estimated signal having an estimated amplitude,estimated frequency and estimated phase; means for subtracting theestimated signal from a received patient monitoring signal to produce anerror signal; and means for modifying the estimated amplitude, estimatedfrequency, and estimated phase of the estimated signal responsive to theerror signal. The estimated amplitude, frequency, and phase are modifiedaccording a formula derived further herein. The adaptive filter, unlikeprior art adaptive filters, adjusts all three parameters (amplitude,frequency, and phase) responsive to the calculated error signal.

The adaptive filter is implemented using a digital signal processor(DSP) that operates under the control of software executed thereby. Ananalog-to-digital (A-to-D) converter is interposed between a patientmonitoring receiver and the DSP for converting the patient monitoringsignals to corresponding digital data at a predetermined sampling rate.The DSP then performs the frequency adaptive FIR filtering thereon. TheDSP also performs several rate change routines, more commonly referredto as decimation routines to decimate the corresponding digital datainto display data at several predetermined sampling rates less than thesampling rate of the A-to-D converter. These sampling rates are chosenaccording to the invention to correspond to the displays in the system.In one case, the rate change routine executed by the DSP converts thecorresponding digital data to LCD display data for a liquid crystaldisplay (LCD) having an LCD sampling rate less than the predeterminedA-to-D sampling rate. The LCD sampling rate is chosen so that each datumof the LCD display data can be displayed on the LCD itself in a singlepixel such that the display rate of the LCD is approximately 25millimeters per second, which is the standard display rate in theindustry. Alternatively, other displays could be used (e.g., EL, CRT,etc.) and the invention adapted to be compatible therewith.

In yet a further aspect of the invention, an optical motion sensor isdescribed. The optical motion sensor includes a light-emitting diode andlight detector. The motion detector is mounted on the "nail" side of thepatient's knuckle to detect the seizure activity based on the flexing ofthe knuckle and on the expansion and contraction of the muscle betweenthe knuckle and the motion detector. The expansion and contractionmodulates the amount of light received by the light detector, which inthe preferred embodiment, is a photoresistor. The photoresistor producesan output signal that is proportional to the intensity of the receivedlight and, therefore, proportional to the seizure activity. These samedevices have been used in the past to detect pulse rate. However, inthis case, expansion and contraction of the tissue due to blood flowcompromises the accuracy of the motion detector. As a result, theoptical motion sensor must be mounted on the patient in an area whichdoes not pulsate in response to blood flow. The "nail" side surface ofthe knuckle is an example of just such an area.

The foregoing and other objects, features and advantages of theinvention will become more readily apparent from the following detaileddescription of a preferred embodiment of the invention which proceedswith reference to the accompanying drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

FIGS. 1A and 1B are a block diagram of the ECT system according to theinvention.

FIG. 2 is a block diagram of the system processor of the system shown inFIG. 1.

FIGS. 3A and 3B are block diagrams of the patient monitoring section ofthe system shown in FIG. 1.

FIG. 4 is a block diagram of the analog-to-digital converter section ofthe system shown in FIG. 1.

FIG. 5 is a flow chart showing the operation of the digital signalprocessor (DSP) of the system shown in FIG. 1.

FIG. 6 is a flow chart of an adaptive filter according to the inventionwhich is implemented by the digital signal processor shown in FIG. 4.

FIG. 7 is a block diagram of the liquid crystal display (LCD) and outputports of the system shown in FIG. 1.

FIG. 8 is a block diagram of the front panel and NVRAM section of thesystem shown in FIG. 1.

FIG. 9 is a block diagram of the digital-to-analog converter section ofthe system shown in FIG. 1.

FIG. 10 is a schematic diagram of the output driver shown in FIG. 9.

FIGS.11A and 11B are block diagrams of the delivery means and hardwaresafety monitors of the system shown in FIG. 1.

FIGS. 12A and 12B are block diagrams of further portions of the safetymonitoring sections of the system shown in FIG. 1.

FIG. 13 is a schematic diagram of a pulse extender circuit shown in FIG.12B.

FIG. 14 is a flow chart of the operation of the system shown in FIG. 1.

FIG. 15 is a schematic diagram of the optical motion sensor and its useaccording to the invention.

TABLE OF CONTENTS

I. ORGANIZATION

A. SYSTEM ARCHITECTURE (FIGS. 1A-1B)

B. SYSTEM PROCESSOR (FIG. 2)

C. PATIENT MONITORING SECTION (FIGS. 3A-3B)

D. ANALOG-TO-DIGITAL CONVERTER SECTION (FIG. 4)

E. ADAPTIVE FILTER (FIGS. 5-6)

F. LCD DISPLAY SECTION (FIG. 7)

G. FRONT PANEL SECTION (FIG. 8)

H. DIGITAL-TO-ANALOG CONVERTER SECTION (FIGS. 9-10)

I. SAFETY MONITORING SECTIONS (FIGS. 11A, 11B, 12A, 12B, 13)

II. OPERATION

A. TEST SEQUENCING (FIG. 14)

B. OPTICAL MOTION SENSOR (FIG. 15)

DETAILED DESCRIPTION

I. ORGANIZATION

A detailed description of the electro-convulsive therapy (ECT) system isgiven below. First, an overall description of the system's architectureand organization is provided, followed by a more detailed description ofseveral major components within that architecture.

A. SYSTEM ARCHITECTURE (FIGS. 1A-1B)

Referring now to FIGS. 1A and 1B, an ECT system is shown generally at10. Certain common components are not shown for simplicity, for example,the power supplies. The ECT system 10 includes several connections tothe patient. The first connection is the ECT stimulus electrodes 12through which an ECT treatment pulse train is applied to the patient andthrough which the patient treatment electrode interface impedance ismeasured. In addition, the system also includes several patientmonitoring inputs 13, 14 and 16 that connect to the patient to receiveEEG, ECG and/or OMS (optical motion sensor) signals, respectively. Theapparatus and method for generating the ECT pulses and monitoring thepatient signals is discussed further below.

The system 10 further includes a user interface 18 through which theuser, typically a psychiatrist, interacts or interfaces with the system10. In one embodiment of the user interface, a plurality of knobs 20 areincluded for setting the parameters that define the ECT pulse train.These parameters include the frequency of the pulse train, the pulsewidth of each individual pulse in the train, the current level, and theduration of the ECT pulse train.

In another embodiment of the user interface, only a single knob isincluded to allow the user to set a single stimulus intensity parameter(e.g., energy or charge). All of the pulse train parameters (pulsewidth, frequency, current, and duration) are then established based onthis setting of this single stimulus intensity parameter. The userinterface 18 also includes a touch screen 22 which is a touch-sensitivedisplay that allows the user to input commands to the system by touchingcertain portions of the screen. The system is menu driven so that theuser can quickly and efficiently move through the command options. Aliquid crystal display (LCD) 24 is provided to display certaininformation to the user both prior to and during treatment. A chartrecorder 26 provides a hard copy output of the patient monitoringsignals. The system 10 further includes a speaker 28 that sounds anaudible alarm when certain failures occur in the system, which aredescribed further below and, as a safety feature whenever the ECTsection is activated. Light-emitting diodes (LEDs) 30 are also providedas indicator lights for the user. A stimulus control section 32 isprovided to allow the user to initiate a treatment. As an alternative, aremote control section 34 is provided that allows the user to initiate atreatment while out of reach of the system. The remote control section34, which works in conjunction with stimulus paddles, disables the(front panel) stimulus control section 32 so that whenremote-control-equipped paddles are plugged into the system, a treatmentcannot accidentally be initiated from the stimulus control section onthe user interface.

At the heart of the ECT system 10 is a computer system 36 whichorchestrates the operation of the system. The computer system includesfour processors: a system processor 38, a safety processor 40, a digitalsignal processor 42, and a front panel processor 44. The systemprocessor 38 is coupled to the knobs, touch screen, LCD, and chartrecorder of the user interface 18. The knobs 20 and touch screen 22 arecoupled to the system processor 38 via the front panel processor 44 thatemulates a standard keyboard interface. Thus, the system processorcommunicates to and from the knobs and touch screen as it would astandard IBM keyboard. This approach was useful during development ofthe system because the knobs and touch screen could then be replaced bya keyboard to provide input to the system.

The system processor 38 is coupled directly to both the LCD 24 and thechart recorder 26 to provide display data directly thereto. As will bedescribed further below, the display data is generated by the DSP 42,which decimates the digitized patient monitoring signals to a samplingrate that is compatible with the two displays (i.e., LCD and chartrecorder).

The system processor 38 is also coupled to a patient monitoring section46 through a sensor control block 48 and an iso-barrier. The sensorcontrol block 48 includes logic that decodes signals received from thesystem processor 38 and configures the patient monitoring section 46into various modes responsive thereto. These modes include the normaloperational mode in which the patient monitoring signals are receivedfrom the patient and test modes wherein the accuracy of the section istested. The patient monitoring section 46 is described further below insubsection I(C).

The computer system 36 also includes a safety processor 40. The safetyprocessor is primarily responsible for coordinating the various safetytests and checks that are performed on and by the ECT system. The safetyprocessor 40 is coupled to the system processor 38 via a serialinterface (SERIAL 1). The safety processor 40 is also coupled to asafety monitoring section 50 which includes equipment monitors 52 andsafety monitors 54. These monitors 52 and 54 monitor both the equipmentas well as the stimulus to determine whether or not the system isperforming within specification and, if not, to disable any furthertreatments.

The safety monitor 54 is further coupled to an ECT block 56 whichgenerates the ECT pulse train responsive to the safety processor 40. TheECT block 56 is directly coupled to the timing circuits of an A-to-Dconverter 58 to receive a Z₋₋ PULSE signal that is generated duringevery sample taken by the A-to-D converter 58. The Z₋₋ PULSE is used bythe impedance-measuring portion of the ECT block 56 to measure patientimpedance, as described further below. The A-to-D converter 58 digitizesthe patient monitoring signals received at inputs 13, 14 and 16 (i.e.,EEG, ECG and OMS). This digitized data is then operated on by the DSP 42to filter out unwanted power line frequency interference by the use of afrequency adaptive finite impulse response (FIR) filter as well asdecimate the digitized data for display.

Safety processor 40 is directly coupled to speaker 28, LED 30, stimuluscontrol 32 and remote control 34. The safety processor 40 initiates anECT treatment sequence, under certain predetermined conditions,responsive to inputs received from either stimulus control 32 or remotecontrol 34. Both the ECT block 56 and the safety processor also actuateeither the speaker or the LEDs if certain conditions exist, e.g.,internal self-test failed. This provides redundant fault and "armingstatus" indications for safety purposes.

The final section of the system 10 is the isolated data output section60. This section is coupled to the computer system 36 via three serialports: a synchronous serial port (SYNC SERIAL PORT) and two asynchronousserial ports (SERIAL 2, SERIAL 3). The computer system 36 is isolatedfrom the isolated data output section 60 by opto-isolator blocks 62 and64. The opto-isolator block 62 is interposed between the DSP 42 and adigital-to-analog converter 66. The DSP 42 transmits the digitizedpatient monitoring signals to the digital-to-analog converter in orderthat those signals may be observed by external equipment coupled toanalog outputs 68. Similarly, the system processor 38 communicates theLCD and chart recorder display data via opto-isolator block 64 to anRS-232 interface block 70, which provides two RS-232 serial output ports72 to enable this data to be printed, displayed, or stored by anexternal peripheral such as a printer or computer. The isolationbarriers here protect the patient and the operator from shock hazardsshould electrical faults occur in the external equipment.

B. SYSTEM PROCESSOR (FIG. 2)

Referring now to FIG. 2, a more detailed schematic of the systemprocessor is shown. The system processor in the preferred embodiments isan 80386(386) microprocessor manufactured by either Intel or AdvancedMicro Devices. The organization shown in FIG. 2 is a typicalorganization employed in, for example, personal computers, in order totake advantage of the numerous components that have been designed for386-based systems. The 386 microprocessor includes an address bus ADDR,a data bus DATA, and a control bus CNTL. These buses are coupleddirectly to an interface chip 74 which generates the signals necessaryfor the 386 to communicate with the other components in the system. Theinterface chip 74 can either be a standard off-the-shelf part that issold by a variety of manufacturers such as Chips and Technology or,alternatively, can be an application specific integrated circuit (ASIC),which can then be manufactured by any number of semiconductor companies.

The 386 microprocessor 38 is coupled to a read-only memory (ROM) 76,which includes the object code of the 386 microprocessor. The ROM 76provides a 16-bit word to the 386 responsive to a chip select signalRCNTL generated by interface chip 74 responsive to a read within apredefined address range being decoded thereby. The particular addresslocation within the ROM is specified by an address SADDR that is latchedin latch 78 responsive to a latch signal ALE generated by the interfacechip 74.

The interface chip 74 also provides an interface between the 386microprocessor and dynamic random access memory (DRAM) 80. As is knownin the art, DRAM has a unique interface that requires both a row and acolumn address multiplexed over a common address bus (MADDR) as well ascertain control signals to be provided in a predetermined sequence. Theinterface chip 74 provides that multiplexed address as well as theappropriate control signals responsive to a valid read or write by the386 within a predefined DRAM address range. The logic within theinterface chip 74 required to perform this interface is well known andis not described further herein.

As described above, the system processor 38 communicates with the knobsand touch screen via a simulated keyboard interface. The interface chip74 generates the control signals on keyboard control bus KBCNTLnecessary to communicate with the front panel processor 44.

The computer system 36 communicates with several of the other blocks andcomponents via the industry standard AT bus. The AT bus is comprised ofaddress bus IOADDR, data bus IODATA, and control bus IOCNTL. The AT buswas chosen because of its simplicity since the data latency andthroughput of the AT bus is adequate for this application. This alsofacilitated a back plane architecture of the system that alloweddifferent portions to be located on separate printed circuit boards thatcould be selectively removed from the system in the event of a failureof a particular component or section. The interface chip 74 along withthe bidirectional data buffers 82 and latch 78 provide the signals forthe AT bus interface. Because this interface is so well known in theart, the logic necessary to support the AT bus is not discussed furtherherein.

C. PATIENT MONITORING SECTION (FIG. 3)

Referring now to FIGS. 3A and 3B, a detailed block diagram of thepatient monitoring section is shown generally at 46. FIG. 3A includesthe circuitry for three patient monitoring signals (EEG1, EEG2, and ECG)while FIG. 3B includes the circuitry for the optical motion sensorsignal (OMS). The circuitry for each of the three patient monitoringsignals shown in FIG. 3A is similar in function, and therefore only onewill be described in detail.

The patient inputs are comprised of leads 13A and 13B, which can beapplied to a patient by (monitoring) electrodes. The patient monitoringsignal EEG1 is then received across these two leads. The patientmonitoring signal is then clamped and filtered by clamp and filter block84, which is coupled to an input amplifier 86. The clamped filter blocklimits the input range of the patient monitoring signal as well asperforms some preliminary filtering (to reduce interference from RFnoise sources in particular) on the signal.

The input amplifier 86 is an instrumentation amplifier which iscontrolled by a feedback loop described further below. The output of theinput amplifier 86 is coupled to a two-position switch S1 whose state iscontrolled by a test signal SHORT INPUTS appearing on line 88. Switch S1is further connected to a summing circuit 90, which sums the switchoutput signal with a signal appearing on line 92. The signal on line 92is a calibration signal approximately 0.2 mV (for EEG) referenced toinput (RTI). This signal is used during the calibration test mode, whichis entered by asserting SHORT INPUTS on line 88. Asserting SHORT INPUTSon line 88, causes switch S1 to switch the input of summing circuit 90to a ground terminal and therefore the output of the summing circuit 90is the calibration signal (CAL TEST) appearing on line 92 whose value isaccurately known to the system. In this way, the system can verify theaccuracy of most of the input section by comparing the signal levelproduced by the input section with the expected signal level of thecalibration signal.

The output of the summing circuit 90 is connected to an input of asecond switch S2. Switch S2 switches between a floating state whereinthe input of summing circuit 96 holds the last voltage it had receivedfrom summing circuit 90 prior to S2 opening, and a closed state whereinthe output tracks the input patient monitoring signal. Switch S2 is usedto decouple the input section from the patient during each pulse of anECT treatment. Switch S2 is responsive to signal STRETCHED PULSE on line94, pulsed by the safety processor for each treatment pulse delivered tothe patient, but lengthened in duration by the ECT section. TheSTRETCHED PULSE signal in combination with switch S2 allows the signalchannel to ignore treatment pulses, since STRETCHED PULSE begins veryslightly before a treatment pulse reaches the patient and continues forenough time after a treatment pulse is finished for input amplifier 86and the patient monitoring electrodes to restabilize.

The output of switch S2 is coupled to a first input (+) of a summingcircuit 96. A second input of summing circuit 96 is connected to line98, which provides a feedback signal that is subtracted from the outputsignal of switch S2 by the summing circuit 96. The output of the summingcircuit 96 is coupled to a low pass filter (LPF) 100. The output of thelow pass filter 100 is connected to an inverting amplifier 102 which, asthe name implies, inverts the output of the low pass filter. The outputof the inverting amplifier 102, in turn, is clamped by a clamp 104,which limits the input voltage applied to integrator 116 and to V-Iconverter for 110.

The output of the clamp is connected to a first input of switch S3 whilethe second input is connected to a reference voltage V_(REF2). The stateof switch S3 is controlled by the signal appearing on line 106. Thissignal switches the switch between the output of the clamp and thereference voltage under one of two conditions. First, where the outputvoltage of integrator 116 exceeds a predetermined maximum limit, (whichoccurs when one or both of the inputs 13A or 13B are unhooked from thepatient, or when the DC offset of the signal between inputs 13A and 13Bis too large for the channel to handle properly) the switch S3 isswitched to the reference voltage V_(REF2). This forces the channeloutput REEG1 to a known level near, but not at, the limit of its dynamicrange. No patient signal could produce such a (sustained) output. Systemprocessor 38 recognizes this condition as a channel error condition.Second, the switch S3 can be switched to the reference voltage duringthe module ID test mode when module ID 156 is asserted. Logic circuit108 is the circuit that asserts the signal on line 106 responsive toeither of these two conditions being satisfied. One of ordinary skill inthe art can readily design circuit 108 to switch S3 during either ofthese two conditions. The standard patient monitoring section (module)can have the aforementioned set of four signal channels present (thoughsome channels can be disabled when not purchased as a fully-equippedoption). All of these modules will have a specified voltage forV_(REF2). Optional modules with different channel specifications can usea different voltage for V_(REF2). The system processor 38 candistinguish module type by reading the reference voltage.

The output of switch S3 is connected to a voltage-to-current converter110 that converts the voltage on the output of switch S3 to a current.This current is then fed to a linear opto-isolation circuit 112 thatoptically isolates the voltage-to-current converter from an opticalreceiver also included in 112. Though not shown in detail, the linearopto isolator circuit is comprised of an LED and two photosensors, oneeach of the latter on either side of the iso-barrier. The photosensorsare matched to each other in performance and the LED illuminates each.The V-I converter is responsive to the photosensor on the isolated sideas well as to the signal from S3 in a manner to provide a stable, linearsignal across the iso-barrier. The output of opto-isolator 112 iscoupled to an amplifier 114 whose gain adjustment is set to calibratethe channel. The output of 116 of the amplifier 114 is a receivedpatient monitoring signal REEG1. It is this signal that is operated onby the system.

The input section also includes a feedback path that reduces the DClevel at the output of the input amplifier 86 depending upon the DCoffset of the patient signal. There are two components in the feedbackpath: an inverting integrator 116 and an inverting amplifier 118. Thesetwo components are connected in series and interposed between the outputof the clamp 104 and the reference input 120 of the amplifier 86. Theintegrator and amplifier remove any long-term drift offset from thepatient monitoring signal presented to S3. In ordinary instrumentationamplifier circuits, the reference input would be connected to a fixedvoltage, and the maximum gain useable from the amplifier is limited to avalue determined by the DC offset that must be tolerated between itsinputs, and the output voltage at which the amplifier saturates. Bymaking the amplifier's reference input responsive in a subtractivemanner to the DC offset of the patient signal, the usable gain of theamplifier can be nearly doubled yet not saturated. By doubling the gainof the first stage in a signal channel, those familiar with the art knowthat if that first stage has very low internally-generated noise, thatthe overall channel noise for a fixed overall channel gain will beimproved.

The output of the integrator 116 is connected to line 98 and to thelogic circuit 108. Thus, the output signal from the integrator issubtracted from the signal received at the first input of the summingcircuit 96, i.e., the patient monitoring signal. The feedback pathproduces a high pass filter. In conjunction with LPF 100, the totalcircuit comprises a bandpass filter as shown in FIGS. 1A-1B.

The integrator 116 further includes a second input that is connected toline 120 for receiving a TRACE RESTORE signal. The TRACE RESTORE signalacts to raise the frequency of the high pass filtering, and allows thesystem processor to rapidly center displayed traces that have driftedoutside a displayable range. The system uses this signal to restore thepatient monitoring signal to the center of the display range undercertain circumstances, for example, if the patient signal is saturatedfor more than one second.

The input circuitry for the other two patient monitoring signals issubstantially identical and therefore not described further. Note,however, that the patient monitoring signals (EEGI, ECG, and EEG2) aremerely illustrative and are not limited to those shown. Moreover, thenumber of signals monitored is not limited to the number shown. Finally,those skilled in the art will be familiar with methods to add a drivenreference output responsive to the common mode content of inputs 13A and13B, or 15A and 15B, or 14A and 14B, to be connected to the patient toreduce common mode signal errors. While beneficial, such a scheme is notrequired for satisfactory operation.

FIG. 3B shows the input section for an optical motion sensor 122 (whichproduces a patient monitoring signal OMS shown in FIG. 1A). The opticalmotion sensor 122 uses a photoelectric technique to detect seizureactivity in the patient. Standard pulse sensors, such as provided by UFIof Morro Bay, Calif. can be used to detect this motion. Pulse sensorshave been used in the past to detect blood flow by placing the pulsesensor on the underside of a patient's digit, such as their index fingeror toe. According to the invention, however, the pulse sensor is placedon the top (i.e., "nail") side of the patient's finger or toe proximateto the joint so that the motion detector detects movement of the jointdue to flexing during seizures, while not detecting very much movementdue to blood flow.

The motion sensor is coupled to the input section via a connector 124.The connector includes three terminals, two for providing power andground and one for receiving the signal (OMS) from the motion sensor.The input section provides a 3.6 volt supply voltage V_(EE) over pin126, ground via pin 128, and receives the motion sensor signal over pin130. The motion sensor produces an output voltage by the voltage divideraction of resistor R3 and photoresistor R2. As the resistance of R2 ismodulated by flexing of the patient's knuckle, the voltage of 130 alsovaries. This signal voltage is provided to one of the inputs of switchS4. Switch S4, like switch SI described above, is a two-position switchthat switches between the input patient monitoring signal and a knownreference voltage, in this case, V_(REF1). The output of switch S4 isconnected to summing circuit 132 which sums the input signal from themotion sensor with the calibration signal CAL TEST on line 92. Theoutput of summing circuit 132 is provided to a summing circuit 134 alongwith the output signal of an inverting integrator 136, which along withlow pass filter 138, amplifier 140, and clamp 142, form a bandpassfilter, as in the other circuits described above. The integrator 136also includes two inputs: one connected to the output of clamp 142 andthe other connected to line 120 to receive the TRACE RESTORE signal.

The output of clamp 142 is connected to a first input of a two-positionswitch S5, the second input being connected to line 105 to receive thereference voltage V_(REF2). The output of switch S5 is connected to avoltage to current converter 144 that is further coupled to a linearopto-isolator 146, which drives an amplifier 148. The output 150 ofamplifier 148 is a received optical motion sensor signal ROMS on output150. The V-I converter 144 and linear opto-isolator 146 operate in amanner identical to their counter parts 110 and 112 in FIG. 3A.

The input section for the optical motion sensor also includes a currentsense amplifier 152. The current sense amplifier 152 detects the amountof current provided by the 3.6 volt supply and switches the state ofswitch S5 from the output of clamp 142 to the reference voltage V_(REF2)if the detected current is less than a predetermined amount. Thiscondition corresponds to having the motion sensor unplugged. Thus, ifthe system detects at the output 150, a DC signal level proportionate toreference voltage V_(REF2), the system can indicate that the motionsensor is unplugged. The current sense amplifier 152 also includes anoverride input 154 that is connected to line 156 which causes the outputof the current sense amplifier to switch S5 to the reference voltageV_(REF2) when the signal on line 156 is asserted. The signal on line 156is asserted when a module ID test function is commanded, as for FIG. 3A,when TRACE RESTORE, CAL TEST, and SHORT INPUTS are all asserted.

These signals and STRETCHED PULSE are provided to the input section fromthe system processor via an opto-isolator block 158.

D. ANALOG-TO-DIGITAL CONVERTER SECTION (FIG. 4)

Referring now to FIG. 4, a more detailed block diagram of the A-to-Dconverter 58 and digital signal processor 42 is shown. The digitalsignal processor 42 performs two primary functions. First, the digitalsignal processor filters the incoming patient monitoring signals toremove unwanted line frequency interference. The DSP 42 accomplishesthis through the use of a frequency adaptive FIR filter. The secondprimary function of the DSP is to change the data rate from thatproduced by the A-to-D converter 58 to those rates required by thevarious displays in the system. Each of these functions will bedescribed now below.

The digital signal processor is, as its name implies, a processor.Accordingly, it operates under control of a program stored in a readonly memory 160. In addition, the DSP 42 uses a local RAM 162 for localread/write storage. The DSP is coupled to these memories 160, 162 overSYSTEM BUS 164, which includes address, data and control signals. Thesystem bus is also connected to the A-to-D converter 58, which allowsthe DSP to interrogate the A-to-D and read the digitized patientmonitoring data therefrom. The SYSTEM BUS 164 is also connected to acontrol logic block 166 that decodes the address and control signals onthe system bus and enables the ROM or RAM accordingly over theirrespective buses (ROMCNTRL, RAMCNTRL). The control block 166 alsoprovides control signals ADCNTL to the A-to-D converter 58 responsive tothe system bus to allow the DSP 42 to read the digitized data therefrom.In this system, the ROM, RAM and A-to-D converter are mapped to uniquesections of the DSP memory space.

The received patient monitoring signals from the patient monitoringsection are provided to the A-to-D converter 58 via input lines 168.These lines carry the above-described patient monitoring signalsincluding EEG, ECG and OMS. The number of these signals can vary betweensystems depending upon the number of input sections in the patientmonitoring section. The A-to-D converter 58, as is known in the art,samples the patient monitoring signals at a predetermined sample rate,which is determined by a clock signal (not shown) provided to the A-to-Dconverter 58. The A-to-D converter 58 includes an interrupt output thatis connected to line 170 upon which an interrupt signal INT is assertedby the converter 58 when the conversion process is complete. Thisinterrupt signal INT is provided to the DSP 42, which produces aninterrupt in the DSP. The DSP 42, responsive to this interrupt, executesan interrupt service routine, wherein the DSP reads the severaldigitized samples from the A-to-D converter 58. This procedure isdescribed further below with reference to FIG. 5. The interrupt line 170is also connected to a clock input of a D-type flip-flop 172, which isconfigured as a divide by two circuit with the inverting output IQconnected to the data input (D). The non-inverting output (Q) of theflip-flop 172 is the Z₋₋ PULSE described above and shown in FIG. 1 thatis used to synchronize with the A-to-D conversion process the patientimpedance measurement function of the ECT section. The DSP can also beused to perform desired statistical patient signal analysis.

E. ADAPTIVE FILTER (FIGS. 5-6)

Referring now to FIG. 5, a flow chart for the DSP operation is showngenerally at 174. The first step for the DSP upon power-up is to executea boot routine at 176. This boot routine begins at a fixed address inROM, usually address zero (OH) and loads up certain boot code into theDSP. Next, in 178, the DSP initializes itself and the A-to-D converter.The content of this step is determined largely by the actual DSP chipand the A-to-D chip used in the implementation.

In step 180, the DSP waits for an interrupt, as described above. If aninterrupt is received, the DSP enters its interrupt service routine andreads the digitized data from the A-to-D converter. The number of wordsread from the A-to-D converter depends upon the number of input channelsin the input section as well as the number of available channels in theA-to-D converter. This is performed in step 182.

The DSP then filters the data to remove unwanted line frequencyinterference. This step is described further below with reference toFIG. 6. The filter according to the invention adapts not only to theamplitude and phase of the digitized data, but also to the frequency.This allows the system to be used in countries which have differingfrequencies for their AC power.

The DSP then proceeds to execute several rate change routines, morecommonly referred to as decimation routines. These rate change routineschange or convert the sampling rate of the data from the sampling rateof the A-to-D converter to a rate required by one of the other sectionsof the system. Decimation itself is a known technique and is thereforenot described in detail. A good treatment of decimation can be found inDigital Filters and Signal Processing, by Leland B. Jackson at pages237-243. What is described is the rate of decimation because thesechoices are optimized to the display rates of the displays within thesystem and the resolution required of the analog output signals.

In the left branch of FIG. 5, the DSP executes a first rate changeroutine in step 186 that decimates the filtered patient monitoring databy a factor of two thereby reducing the effective sampling rate byone-half. Next, in step 188, the DSP executes a second rate changeroutine that further reduces the effective sampling rate by a factor ofthree. This decimated data, which has an effective sampling rate ofone-sixth of the sampling rate of the A-to-D converter, is thentransmitted to the A-to-D converter 66 over a synchronous SERIAL port200 (FIG. 4) in step 190. The effective sampling rate is chosen toproduce a resolution in the analog output signals generated by theA-to-D converter of 256 samples per second, which is the generallyaccepted resolution for these patient monitoring signals.

Concurrently with steps 186-190, the DSP decimates the filteredpatient's monitoring signal data for display on the chart recorder andthe liquid crystal display (LCD). The DSP first decimates the filterdata by a factor of 11 in step 192. The effective sampling rate producedthereby is the resolution required by the chart recorder. Accordingly,in step 194, the output of step 192 is transmitted to the systemprocessor over the AT₋₋ BUS which then forwards the data onto the chartrecorder.

The output of step 192 is further decimated by a factor of two in step196. This second decimation routine produces LCD display data that hasan effective sampling rate optimized for the LCD display. The twodecimation routines 192 and 196 produce an effective sampling rate suchthat each datum of the LCD display data corresponds to an individualpixel on the LCD display at a display rate of 25 millimeters per second,which is the accepted display rate for medical equipment. Thus, bychoosing the A-to-D conversion rate and the decimation factorsappropriately, the system minimizes the number of routines necessary toproduce the required display data.

Medical monitoring equipment utilizing patient electrodes always picksup large amounts of line frequency interference through the patientelectrodes. When the line frequency is known, standard adaptive finiteimpulse response (FIR) notch filter effectively removes thisinterference. Alternatively, if a sample of the line frequenciesavailable, e.g., from a transformer tap, then this may be used with theadaptive notch filter to remove the interference.

In international product applications, the line frequency depends uponthe country. If no sample of the line frequency is available, such as inlow cost equipment, it would be most desirable to use an adaptive filterwhich determines the line frequency and then cancels the interference.Preferably, this filter should be a FIR filter in order to not disturbthe desired signals'phase properties. The traditional LMS algorithm maybe used to develop a filter capable of identifying the line frequencyinterference and rejecting it. The following description describes suchan implementation according to the invention.

Following the procedural outline in Woodrow and Sterms, Adaptive SignalProcessing, at pages 99, 100 and 101, the line frequency component maybe estimated as follows:

    phase+=the Δ                                         (1)

    EST=A×cos (phase)+B ×sin (phase)               (2)

where A, B and Δ are parameters to be adjusted at each iteration

Given initial values of A, B, phase and Δ, the above estimate of thedata is then used with the new data value to compute an error value asfollows:

    diff=(data-EST)                                            (3)

    err=diff.sub.2                                             (4)

We want to minimize the err function with respect to A, B, and phase.The gradient of err produces a vector in the direction of maximumincrease, i.e.: ##EQU1## Where a, b and δ are unit vectors for therespective variables. We then apply a small amount of the negative ofthis gradient vector to the Current coordinate values (A, B and Δ).Thus, the three variables are related as follows:

    a·A+b·B+δΔ-=β×grad (err)(6)

or

    A-=β×diff×cos (phase)                     (7)

    B-=β×diff×sin (phase)                     (8)

    Δ-=×diff× i B×cos (phase)-A×sin (phase)!(9)

where β is a constant that determines the rate of convergence.

The variable Δ is proportional to frequency. Thus, by adjusting thisvariable the frequency of the estimated signal EST can be adjusted totrack or adapt to the frequency of the data. The equation relating thefrequency F of the estimated signal EST (i.e., the filter) can bederived as follows:

    F=Δ·F.sub.s /CPC,

where F_(s) is equal to the sampling frequency of the filter (in thiscase the A-to-D converter) and CPC is equal to the number of counts percycle. In the preferred embodiment _(s) equal to 1536 Hz and CPC isequal to 65536. This latter value was chosen so that a range of CPCs of0 to 65536 would correspond to an angle of 0 to 2π radians.

Similarly, adjusting the variables A and B is equivalent to adjustingthe amplitude and phase offset of an arbitrary sinusoid due to thefollowing equivalence:

    Acos (phase)+Bsin (phase)=αcos (phase-offset)

where α=(A² +B²)^(1/2) and offset =arctan(B/A).

Referring now to FIG. 6, a flow chart of the frequency variable adaptivenotch filter is shown generally at 200. The method shown is executed foreach sample of the patient monitoring signals. It should be apparentthat each patient monitoring signal is filtered independently of theothers. The method shown, however, refers only to a single patientmonitoring signal.

In step 202, a new data sample is read from the A-to-D converter by thedigital signal processor. Next, the frequency, phase and amplitude ofthe signal is estimated in 204. These three parameters are estimatedbased on the formulas given above. An error (err) is calculated in 206according to the formula (4) above. Finally, the frequency phase andamplitude are adjusted in 208 by recalculating the parameters (A,B,Δ)according to the formulas (7-9) shown above. This sequence is repeatedfor each data sample. A C++ implementation of a filter based on theseprinciples is shown in Appendix A.

F. LCD DISPLAY SECTION (FIG. 7)

Referring now to FIG. 7, a more detailed schematic diagram of the LCDdisplay section is shown. In addition, the two serial ports (SERIAL2,SERIAL3) and a parallel port (PRINTER CONNECTOR) are shown. All of thesecomponents interface to the system processor over the AT₋₋ BUS, which isprovided over the back plane. A set of bidirectional buffers 212 areinterposed between the AT data bus IODATA and the other components inFIG. 7. A logic block 214 is coupled to the AT address bus IOADDR andthe AT control bus IOCNTL. The logic box 214 decodes the address on theaddress bus IOADDR responsive to the control signals on the 10 busIOCNTL according to a predetermined memory map in which the componentsin FIG. 7 are mapped.

The LCD display section includes an LCD controller 216, which is anindustry standard part. The LCD controller communicates with the systemprocessor over DATA BUS 218. The system processor communicates with theLCD controller using the AT bus protocol, as is well known in the art.

The system processor writes data and commands to the LCD controller overthe AT₋₋ BUS, which commands are decoded by the logic block 214 andwhose data is allowed to pass through the bidirectional buffers 212 andinto the LCD controller 216 via DATA BUS 218. The logic block 214enables the LCD controller 216 to receive this data by asserting theappropriate control signals on LCD bus 220. The LCD controller 216 isessentially in a master/slave relationship with the system processorwherein the LCD controller is the slave.

The LCD controller 216 is coupled to an LCD RAM 222 and to an LCDdisplay 224. The LCD RAM 222 stores the display data which iscommunicated to the LCD controller by the system processor. The LCDcontroller 216 reads and writes data to the LCD RAM 222 over a DATA BUS226. The LCD controller specifies the address of a particular LCD RAMlocation by providing an address on address bus 228 and assertingappropriate control signals on control bus 230 and logic block 232enables the LCD RAM 222 by asserting enable signals on bus 234responsive to the appropriate address and control signals on buses 228and 230.

The LCD controller 216 provides the display data stored in LCD RAM 222to the LCD display 224 over DATA BUS 236 by asserting the appropriatesignals on control bus 238.

As described above, the LCD display has a particular resolution definedas so many pixels per inch. The LCD display further includes apredetermined display rate which defines the rate at which data, andparticularly signal data, moves across the LCD screen. The decimationroutines described above are designed so that each datum produced by thedecimation routine can be displayed on a single LCD pixel at a displayrate of 25 millimeters per second, which corresponds to thewell-accepted industry standard display rate. This avoids having to doany interpolation to produce the desired display rate.

Also shown in FIG. 7, is a UART 240 which is interposed between thesystem processor 38 and the safety processor 40 (FIG. 1A). The UART 240provides a serial interface (SERIAL1) between the system and safetyprocessors to allow communication there between. The UART 240 is anothermemory mapped peripheral on the AT₋₋ BUS, as is the LCD controllers andothers. The UART 240 therefore communicates with the system processorover DATA BUS 218 and is selected or enabled by appropriate signalsbeing asserted by logic block 214 on UART bus (UART1₋₋ BUS) 242.

The other two serial polls (SERIAL2, SERIAL3) are also shown in FIG. 7.Two additional UARTs 244, 246 provide these two serial interfaces. TheUARTs 244,246 communicate with the system processor in a conventionalmanner over the AT₋₋ BUS as does UART 240. The UARTs 244 and 246 areisolated optically from external RS-232 interfaces 248 and 250 byopto-isolators 252 and 254, respectively. The UART 244 is used toprovide digital patient information to an external peripheral over astandard RS-232 connection. The other UART 246 is used to providemiscellaneous other data that can be monitored and/or stored on acomputer or peripheral.

Also shown in FIG. 7 is a parallel port 257 through which the systemprocessor provides data to an external printer. The parallel port 257provides a standard Centronix type connection.

UARTs 244 and 246 and parallel port 257 are enclosed by a broken line toindicate that, although these are separate functions, they can becontained within a single component such as a 16C552.

G. FRONT PANEL SECTION (FIG. 8)

Referring now to FIG. 8, a block diagram of the front panel section isshown. The front panel includes a plurality of switches 254, 256 and258, which are used to specify or reset the parameters of the ECT pulsetreatment. These parameters include frequency, pulse width, current andtreatment duration, among others. Any number of relevant settings can beprovided in this manner. The front panel section includes amicrocontroller 260, which in the preferred embodiment is an 8051microcontroller. Because of the limited number of inputs provided onmicrocontroller 260, a multiplexer 262 is interposed between theswitches 254-258 and the microcontroller 260. The multiplexer providesone of the switch settings to the microcontroller depending upon aSELECT signal on a select bus 264. The switch position for the selectedswitch is communicated to the microcontroller over the switch positionbus 266. In this way, only a single set of inputs on MC 260 is requiredto read all of the switch positions. If sufficient inputs were availableon MC 260, however, the MUX 262 could be eliminated.

The microcontroller 260 is also coupled to the front panel itself 268through which commands are input to the system. The microcontroller 260communicates with the front panel 268 over bus 280.

An industry standard keyboard connector 272 is provided through whichthe microcontroller 260 communicates with the system processor. Abuffer/driver circuit 274 is interposed between the microcontroller 260and the keyboard connector 272 to provide the necessary signalconditioning required by the industry standard keyboard interface. Themicrocontroller communicates with the system processor as if themicrocontroller 260 were a keyboard. This interface was chosen so thatduring development, the front panel section could be replaced by anactual keyboard to allow for efficient input of commands to the systemcontroller by simply pressing the desired key.

On the other side of the keyboard connector 274 is an industry standardkeyboard controller 276 which receives the keyboard commands from themicrocontroller 260 and communicates these commands to the systemprocessor over the AT₋₋ BUS. The keyboard controller 276 in thepreferred embodiment is an 8042 industry standard controller. Thekeyboard controller 276 also includes a buffer driver circuit 278 thatplaces the keyboard commands in the appropriate format in order to bereceived by the keyboard controller 276. The keyboard controller 276then communicates the received keyboard commands from themicrocontroller 260 using the conventional keyboard protocol. In thisway, the system processor need only use a standard keyboard processingroutine to receive commands from the front panel interface section.

Also shown in FIG. 8 is a timer and non-volatile RAM (NVRAM) circuit280, which is also coupled to the AT₋₋ BUS. The timer and NVRAM circuit280 are mapped into the system processor's memory space, as is thekeyboard controller 276. A logic block 282 decodes the address andcontrol signals provided on the AT₋₋ BUS and enables the timer and NVRAMcircuit accordingly. In this way, the system processor can communicateto and front the timer and NVRAM circuit over the AT₋₋ BUS. The logicblock 282 includes a set of latches which latch an address provided onthe AT data bus IODATA and provide this address (TADDR) to the timerNVRAM circuit over a dedicated address bus 284. The timer and NVRAMcircuit 280 then provides the data corresponding to this address on theAT data bus IODATA responsive to control signals received on the timerand NVRAM control bus 286. In the preferred embodiment, the timer andNVRAM circuit includes a DS1386 part manufactured by DallasSemiconductor.

H. DIGITAL-TO-ANALOG CONVERTER SECTION (FIGS. 9-10) Referring now toFIG. 9, a detailed block diagram of the digital-to-analog (D-to-A)converter section is shown. As described above, the digital signalprocessor 42 provides its filtered and decimated data to the isolateddata output section 60 so that the patient monitoring signals can bedisplayed or captured by an external device. This data is provided overa synchronous serial port 288. Coupled to the serial port 288 is asynchronous serial interface circuit 290 that receives the serial datafrom the digital signal processor. An output bus 291 is coupled betweenthe synchronous serial interface and a serial to D-to-A interfacecircuit 292. The bus 291 includes the standard transmit and receivesignals that comprise a serial interface. The circuit 292 converts theserial inputs to a format required by the D-to-A converter 66. TheD-to-A converter 66 is optically isolated from the circuit 292 by anopto-isolator circuit 294, which is known in the art.

The D-to-A converter 66 includes a plurality of output channels, whichare coupled to an output driver 296. The design of the D-to-A converterand output driver shown in FIG. 10 is well-known in the art and istherefore not discussed further.

The circuit shown in FIG. 10, however, is repeated for each of theoutputs of the D-to-A converter. In the preferred embodiment, there areeight analog outputs, i.e., N = 8.

1. SAFETY MONITORING SECTIONS (FIGS. 11-13)

The heart of the safety features of the system is shown in FIGS. 11-13.Before discussing the safety features, however, we will first discussthe ECT pulse generator circuit.

Referring now to FIG. 12A, the safety monitoring circuit shown thereinincludes an input 298 for receiving an input signal PULSE₋₋ IN. Thissignal is generated by the safety processor each time a treatment pulseis to be generated. The pulse width of this signal is set from the frontpanel by adjusting the appropriate knob to the desired setting. Thissetting is then read by the safety processor, which generates the pulsewidth accordingly. In the preferred embodiment, two timers are used toform the pulse width and frequency of the signal PULSE₋₋ IN.

The user can also set the frequency of the treatment pulse train bysetting the appropriate knob on the apparatus. This frequency settingdetermines the period between the leading edge of the successivetreatment pulses. In addition, the user can set the total duration ofthe treatment pulse train, which is the duration of the ECT treatment.The user can also set the current level in a similar manner.

The PULSE₋₋ IN signal is provided to a maximum frequency limiter circuit300, which limits the frequency passed on to the ECT driver circuits toa maximum frequency as specified by the circuit 300. If the frequency ofPULSE₋₋ IN exceeds this frequency, the limiter inhibits generation offurther ECT pulses. In the preferred embodiment, this frequency limitercircuit 300 is implemented by a retriggerable one shot, e.g., 14538,whose RC time constant sets the maximum frequency of the circuit. Theinput 298, in that case, is connected to the positive edge trigger input(+T) of the one shot. The reset input (R) of the one shot is connectedto a control input 302 for receiving a control signal CNTL1 from thesafety processor. Thus, the safety processor can prevent the frequencylimiter circuit from passing on any pulses by asserting this signal. Thefrequency limiter circuit 300 produces an output on line 304 whoseleading edges track the leading edges of input PULSE₋₋ IN if thefrequency of the input signal is less than the maximum frequency limitof the circuit and has a frequency equal to zero if the input pulsefrequency exceeds that maximum frequency.

The output of the max frequency limiter 300 is connected to a max pulsewidth limiter circuit 306. The limiter circuit 306, as limiter 300 didfor frequency, limits the pulse width of the pulses passed on to the ECTdriver circuits to a predetermined maximum pulse width. If the pulsewidth of PULSE₋₋ IN exceeds the maximum pulse width, limiter 306 limitsthe pulse width to the maximum predetermined pulse width. This limiter306 in the preferred embodiment is also implemented using a one shot,e.g., 14538, but in a non-retriggerable mode. The maximum pulse width isset by the RC time constant of the one shot. The inverted output of theone shot is connected to the negative edge trigger input of the one shot(-T) to prevent retriggering, and the reset input (R) is connected toinput 298 to receive the input PULSE₋₋ IN. When the width of PULSE₋₋ INis less than the timeout period of one shot 306, the normal case, thelatter connection causes the width of pulse passed on to the ECT drivercircuits to be equal to the pulse width of PULSE₁₃ IN.

The input PULSE₋₋ IN is also provided to a frequency divider 308, whichdivides down the input pulse rate by a factor of two. The output of thefrequency divider 308 is coupled to a first select input of the analogMUX 310 on line 312. Similarly, the output of the pulse width limiter306 is coupled to a second select input of the analog MUX 310 via line314. Line 314 is also connected to a pulse extender 316 which delays thetrailing edge of the pulse to provide a longer pulse signal STRETCHEDPULSE that is used to disconnect the patient monitoring signals from theinput section when each treatment pulse is applied. The pulse extenderis described further below.

The analog multiplexer 310 also includes two analog inputs. The firstone of these inputs is connected to input 318 for receiving a signalPULSE₋₋ LEVEL, which establishes the output current level of the ECTpulse. Another one of the analog multiplexer inputs is connected to afixed voltage source of -0.5 volts. The signal levels on the selectinputs of the MUX determine which of the two inputs is passed through tothe multiplexer outputs OUT1 and OUT2. Configured in this way, theoutputs are responsive to the input pulse PULSE₋₋ IN.

The first output of the analog MUX OUT1 is connected to thenon-inverting input of amplifier 320. Similarly, the second output OUT2is connected to the non-inverting input of amplifier 322. The invertinginputs of both amplifiers 320 and 322 are connected to the emitters ofoutput transistors Q1 and Q2. The outputs of amplifiers 320 and 322 areconnected to drive output transistors Q1 and Q2, respectively by meansof power MOSFET transistor drivers (not shown) one connected to the baseof Q1 and another to the base of Q2 in the darlington configuration.Power is provided to both amplifiers 320 and 322 from a 20 voltregulator 324 through a switch S10. The switch S10 provides either the20 volt supply voltage to the amplifiers on line 328 or a ground signaldepending upon the state of switch S10, which is controlled by logicgate 326. Thus, logic gate 326 can remove power from the outputamplifiers depending upon the state of its inputs. This is a safetyfeature, which is described further below.

A current limiting circuit 330 clamps the output voltage of theamplifiers 320 and 322 if the currents through output transistors Q1 andQ2 exceed a predetermined current limit. The collectors of Q1 and Q2form the two outputs for generating the ECT pulses. A third output isprovided by a 33 volt regulator 332. These three outputs connect to thecenter-tapped primary winding of transformer T1 shown in FIG. 11A.

Referring to FIG. 11A, the three outputs (+,-, and POWER) are connectedto the center-tapped primary winding of transformer T1. Transformer T1is a step up transformer so that the voltage across the secondarywinding (FIG. 11B) is equal to the turns ratio times the voltage acrossthe primary. The current in the secondary, on the other hand, is reducedby the turns ratio. In the preferred embodiment, the turns ratio isequal to 16.6:1.

A relay R1 is interposed between the outputs of the secondary windingand two paddles 334 and 336. The paddles are shown with the optionalremote control unit 338. Alternatively, paddles 334 and 336 could besimple electrodes that are used when the treatment is initiated from thefront panel as described further below.

The relay R1 is used to switch a dummy load R7 into and out of thecircuit of the secondary winding of T1. When the relay is in theposition shown in FIG. 11 B, the dummy load is switched into the circuitand when the relay is in its other position, the dummy load is taken outof the circuit and the winding is connected to the paddles 334 and 336.The state of the relay is controlled by a logic gate 338 whose output isconnected to the coil of the relay via line 340. The logic gate 338includes two inputs 342 and 344 for receiving a hardware shutdown signalHW₋₋ SD (FIG. 12B) and a control signal CNTL2 (FIG. 12A). The logic gate338 switches from the dummy load to the patient, i.e., the paddles, ifthe control signal CNTL2 is asserted and the hardware shutdown signalHW₋₋ SD is not asserted. This provides the system with the ability toshunt the pulse to a dummy load under software control as indicated bythe assertion of the control signal CNTL2, which is under control of thesafety processor. The control signal CNTL2 allows the system to performan internal self-test in which a pre-treatment pulse train is applied tothe dummy load and the characteristics of the pulses are then examinedby the safety hardware and the system rendered inoperable if any ofthese safety tests fail.

The safety monitoring section also includes a second relay R2 (FIG.11B), which is used to either short out, or leave unshunted, a 10 K ohmresistor R8 in the output circuit under certain test conditions. This 10K ohm load is shorted by R2, thus effectively shorting the secondarywinding of transformer T1 when a control signal CNTL3 is asserted. Thiscontrol signal is applied to the coil of relay R2 via input 346. The 10K resistor and relay R2 are used during the self-tests of theinstrument's ability to measure static impedances at zero ohms and 110 Kohms.

A second transformer T2 is used to measure the voltage delivered to thedummy load during pre-treatment testing. The voltage across the primaryof T2 is stepped down to the secondary, which is then measured by avoltage monitoring circuit 348. A current is provided to the secondarywinding by an AC current source 350, which generates a fixed currentresponsive to the Z₋₋ PULSE received on input 352. This causes a currentof approximately 40 μA through the secondary of T2. Because the currentAC amplitude is fixed, then the voltage measured by the voltagemonitoring circuit 348 is proportional to the static impedance (of thepatient or of the impedance self-test resistor R8). The measured voltageDELIV₋₋ V is provided to the safety processor from the voltagemonitoring circuit on output 354. A signal corresponding to the measuredimpedance IMP is provided by the voltage monitoring circuit to anamplifier 356 whose output is then rectified by precision rectifier 358and filtered by low pass filter 360. The output of low pass filter 360is a signal Z on output 362 that is proportional to the measured staticimpedance.

The circuits described above measure what is termed "static" impedance.Static impedance in the context of ECT is the impedance measured undertest conditions of very low currents applied to the patient (or testresistors). Static impedance changes little with continued applicationof the current used to perform the measurement. "Dynamic" impedance inthe context of ECT, on the other hand, is the effective impedancepresented by the patient's scalp and the paddle electrodes to theapplied treatment current. Dynamic impedance is the impedance observedat very high applied currents, where the scalp tissue exhibitsnon-linear impedance behavior. The dynamic impedance seen in ECT is muchlower than the static impedance seen in ECT, and furthermore, decreasesgenerally during the duration of the treatment. Dynamic impedance iscalculated by the system processor by dividing the delivered voltage bythe delivered current. Signal Z on line 362 is not used to obtaindynamic impedance.

The circuit also includes another transformer T3, which is used tomeasure the current through the output circuit of TI. The transformer T3is a (voltage) step up transformer whose secondary is coupled to acurrent monitoring circuit 364 which measures the current through theoutput circuit. This measured current signal DELIV₋₋ I is then providedto the safety processor on output 366.

The circuit also provides an energy monitor circuit. The energy monitorincludes an analog multiplier 388, a voltage-to-frequency converter 390,a two-stage counter 392 and an energy limit select circuit 394. Theanalog multiplier has two inputs: one of which is connected to thevoltage monitoring circuit 348 to receive the measured voltage signalDELIV₋₋ V; and the second input is connected to the current monitoringcircuit 364 to receive the measured current signal DELIV₋₋ I. The analogmultiplier then multiplies these two signals together to produce adelivered power signal DELIV₋₋ P on output 396. The delivered powersignal is then provided to a voltage-to-frequency converter 390 whichconverts the voltage level of the delivered power signal to a clocksignal having a frequency proportional to that power signal level. Theclock signal is provided to a clock input of a counter 392, which in thepreferred embodiment is implemented by cascading two binary counters.The counters produce a binary count that increments with each risingedge of the clock signal from the voltage-to-frequency converter 390.This binary count is then provided to a maximum energy limit selectcircuit 394 which compares the binary count to a preset limit. If thebinary count exceeds this preset limit, the circuit 394 asserts a signalENERGY₋₋ MAX on output 398 to indicate that the amount of energydelivered to the patient during this treatment has exceeded thepreselected limit. In the preferred embodiment, the limit is adjustablewith the use of jumpers to allow for different limits to be set indifferent countries or under different conditions. It should be apparentthat the voltage-to-frequency converter and counter are but oneimplementation of what is essentially an integrator, which integratesthe delivered power signal DELIV₋₋ P over time. Other integrators, ofcourse, can be used.

The paddles 334 and 336 are part of an optional remote control packagethat allows the user to initiate an ECT treatment from the paddles.Otherwise, the user can only initiate a treatment from the front panelstart treatment switch. One of the paddles includes a two-stage switchrepresented by switches S11 and S12 in FIG. 11B. The first switch S11initiates a pre-treatment test sequence. Actuation of switch 11 isdetected by measuring the current through the optional remote controlunit. This is accomplished by switching different resistances into thecircuit according to which switch is actuated. Switch S11 is normallyopen, as indicated in FIG.11B. In addition, switch S12 is normally inthe position shown. In this default state, a circuit is formed withresistors R9 and R10 across which a voltage is supplied by remotecontrol power supply 400. The current supplied by the power supply 400is detected by a current monitoring circuit 402 which is coupled to thepower supply 400 by a transformer T4. The current monitor 402 produces asignal RC₋₋ SENSE, which is proportional to the measured currentsupplied by the power supply 400. This signal RC₋₋ SENSE is provided toa threshold detector 404, which compares the current level of the signalRC₁₃ SENSE to determine whether the current level exceeds apredetermined amount. If insufficient current is detected, the circuit404 assumes that the remote control unit is not connected. If thecircuit, however, detects this minimum current level, then the circuit404 switches the state of switches S13, S14 and S15 so as to disable thefront panel switch S16, which is also used to initiate a treatmentsequence.

If the test switch S11 is actuated, on the other hand, resistor R12 iscoupled in parallel with resistor RIO, thereby presenting a differentload to the remote control power supply 400. This current is alsomeasured by the current monitor 402.

The treatment switch S12 actually corresponds to the second stage of thetwo-stage switch comprised of S11 and S12. Therefore, S12 can only beactuated if S11 is also actuated. If S12 is actuated (and thereforeS11), a circuit is formed with R9, R11 and light-emitting diode D3 of anopto-coupler. Passing a current through diode D3 causes a signal to beproduced by optical detector Q3, which is then passed on to the safetyprocessor as the TREAT₋₋ RELEASE signal through switch S13. This signalcan then be used to determine if the treatment switch S12 is releasedprior to the full treatment duration that was programmed by the frontpanel controls.

Referring again to FIGS. 12A and 12B, three control signals CNTL1, CNTL2and CNTL3 are shown being received at inputs 302, 410 and 412,respectively. These input signals are provided to a D-to-A converter 414which produces an analog signal control on DAC output 416, whichreflects the signal levels on the three control signals. The DAC 414, inthe preferred embodiment, is a simple resistive summing circuit thatadds the binarily weighted control signals CNTL1-CNTL3 to produce theanalog control signal CONTROL on output 416. This control signal is thenread by the safety processor to verify the state of the control signalCNTL1-CNTL3. This provides an additional check to ensure that the systemis configured in the manner desired by the safety processor.

Control signals CNTL1 and CNTL2 are provided to an AND gate 418 thatlogically ANDs these two signals together (CNTL1 and CNTL2 are high atthe same time only during a patient treatment mode) to produce an outputsignal on line 420 that is coupled to a control input of switch S20, areset input of one shot 422 and an input of logic block 424. Switch S20provides either a ground signal on line 426 or a treatment buttonrelease signal TREAT₋₋ RELEASE, which is asserted when the selectedstart treatment switch is prematurely released. Line 426 is then coupledto an input of an OR gate 428, whose output 430 is a hardware shutdownsignal HW₋₋ SD. This hardware shutdown signal immediately removes powerfrom output amplifiers 320 and 322 by causing switch S10 to switchthrough gate 326. Thus, the pulse output amplifiers will be disabledwhenever (1) either CNTL1 or CNTL2 is deactivated (treatment finishednormally, and the safety processor has caused the disablingintentionally), or (2) when the selected treatment switch is releasedprematurely during a treatment, or (3) a fault condition such as maximumenergy is reached.

The OR gate 428 also includes another input for receiving a timerexpired signal TIMER₋₋ EXPIRED on line 432. This signal is generated bya ten-second timer 434, which asserts the signal any time the timerexceeds ten seconds without being reset. The timer 434 includes a clockinput that is driven by a 186 Hz oscillator 436, which produces a clocksignal on line 438. This clock signal is gated by logic gate 440, whichallows the clock signal to pass through to the clock input of the timeras long as the hardware shutdown signal HW₋₋ SD is not asserted. If thehardware shutdown signal HW₋₋ SD is asserted, logic gate 440 blocks theclock signal. This prevents the timer 434 from being incrementedfollowing a hardware shutdown. This further allows the system todetermine what was the cause of the hardware shutdown, e.g., expirationof timer 434. The reset input of the timer 434 is driven by a logicblock 442 that has two inputs: a first input coupled to an Output of oneshot 422; and a second input coupled to input 298 to receive the signalPULSE₋₋ IN. As described above, the PULSE₋₋ IN signal is asserted duringeach pulse. The one shot 422, on the other hand, produces an outputsignal on line 444 at the end of each ECT pulse train responsive to areset signal RESET on input 446. The logic block 442 contains a latch(not shown) which holds a reset signal on line 448 until that latchedreset is removed by the first pulse in an ECT pulse train. The timer 434then runs from that point. The timer 434 continues to run until theconclusion of the treatment. If a fault occurs which allows thetreatment duration to exceed ten seconds, the timer will expire therebyproducing a hardware shutdown. Thus, timer 434 is a pulse train durationdetector that prohibits or disables further treatment if the ECT pulsetrain duration exceeds the ten second maximum duration. As a safetyfeature, one shot 422 is prevented from resetting counter 434 during apatient treatment by gate 418, which holds one shot 422 in reset duringthe treatment.

The system also includes a watchdog timer 450 that has a reset inputcoupled to input 452 for receiving a watchdog reset signal WD₋₋ RESETand a clock input coupled to input 454 for receiving a watchdog clocksignal WD₋₋ CLK from the safety processor. The watchdog timer 450includes an output that is coupled to line 456 that is connected tooutput 458 and to one of the inputs of gate 428. The watchdog timer 450produces a watchdog failure signal WD₋₋ FAILURE if the watchdog timer450 is not clocked within a predetermined time following the last clocksignal WD₁₃ CLK. The watchdog timer therefore causes a hardware shutdownif the watchdog timer 450 is not clocked within this time period.

The watchdog timer ensures that the safety processor is functioningproperly. The safety processor includes a routine that is invokedperiodically. Under control of that routine, the safety processorrepeatedly clocks the watchdog timer. Thus, if the watchdog timer is notclocked, it means that the safety processor has failed to execute thisroutine as it was suppose to. The system therefore disables furthertreatment in that case. WD₋₋ RESET on 452 is activated at power up ofthe instrument, and for any other condition that would cause a reset ofthe system processor, e.g., logic supply voltage being too low.

Another condition that can produce a hardware shutdown is where themaximum energy (as set by regulatory organizations) for the ECT pulsetrain is exceeded. This condition is detected by energy limit selectcircuit 394, as described above. The output of circuit 394 is coupled toinput 460 (FIG. 12A), which is then provided to one of the inputs of ORgate 428. The OR gate 428 in turn produces a hardware shutdown signalHW₋₋ SD if the output of the energy limit select circuit 394 is asserted(i.e., ENERGY₋₋ MAX).

The OR gate 428 includes an additional input that allows the hardwareshutdown signal HW₋₋ SD to be fed back to its input switch S21 so thatthe system remains in the hardware shutdown state once that conditionexists. The system can clear the hardware shutdown condition by clockingthe one shot 422, which causes the switch S21 to switch between thehardware shutdown signal HW₋₋ SD and ground. The hardware shutdowncondition will be cleared then assuming that none of the other hardwareshutdown conditions (i.e., TIMER₋₋ EXPIRED, WD₋₋ FAILURE, ENERGY₋₋ MAX,TREAT₋₋ RELEASE) exist.

Referring again to FIG. 12B, a pulse extender circuit 316 is shown. Thispulse extender takes the input pulse signal on line 314 and delays itstrailing edge to produce the signal STRETCHED PULSE on output 462. Thisoutput, as described above, is used to inhibit reception of the patientmonitoring signals during application of each ECT pulse. This allows forbetter response from the patient monitoring section (FIG. 3). Aschematic of the preferred embodiment of this pulse extender circuit 316is shown in FIG. 13. The circuit uses a 14538 one shot 468 and an RCnetwork shown generally at 472. The one shot has two OR'd clock inputs;the negative-edge-trigger clock input receives its input signal on line314 from FIG. 12B. The other clock input of the one shot is connected tothe non-inverting output (Q) of the one shot so as to prevent"retriggerability." The RC network is coupled to the RC input of the oneshot. The time constant of these two components determines the amount oftime by which the trailing edge of the output signal STRETCHED₋₋ PULSEis delayed relative to the trailing edge of the input signal on line464.

Referring again to FIG. 12B, an AND gate 476 is included, whichgenerates a tone signal TONE on output 482 when relay R1 (FIG. 11B) isconnected to the paddles and power is supplied to the output driveramplifiers. The AND gate 476 includes two inputs: one of which isconnected to input 478 to receive a patient connected signal PATIENT₋₋CONNECTED, which is asserted when relay R1 is connected to paddles; anda second input coupled to a voltage divider circuit 484 that dividesdown the twenty-volt supply voltage produced by regulator 324 to providea five-volt signal on line 480 when switch S10 is set to receive thesupply voltage. The tone signal TONE then drives an audio indicator toinform the user of the current condition of the system. Thispurely-hardware path is a safety feature that operates independently ofthe system processor's means to drive the audio indicator.

II. OPERATION (FIG. 14)

A. TEST SEQUENCING (FIG. 14) The heart of the Applicant's invention isthe advanced safety feature set included in the ECT apparatus. Thesesafety features include both hardware and software safety detectors andmonitors. Safety tests are performed during both pretreatment andtreatment. This level of redundancy and frequency provides patientsafety heretofore not found in ECT apparatus. The operation of thesesafety tests is now discussed.

Referring now to FIG. 14, a flow chart of the test sequencing of thesystem is shown. The test sequence begins in step 500 where the variousprocessors perform their processor hardware start-up test sequences.This start-up sequence includes initializing ports and configuring themas either input or output ports. The general purpose registers are thentested by writing to and reading from all of the general purposeregisters of the microprocessor. Certain processors include registerbanks and in those cases, each register bank is tested. In addition,some processors include special purpose registers. These registers canbe tested in the same way as the general purpose registers, i.e.,writing to and reading from those registers. Each processor includes astatus register which includes a plurality of bits or fields thatindicate the existence of a certain condition. These conditions are thenforced by the microprocessor and then the corresponding status bit orfield is tested. Each processor then executes a test of all internal andexternal memory. For the random access memory, the processor writes apredetermined pattern to each memory location and then reads it back.Usually, more than one write and read is required for each location toensure that none of the memory cells are stuck in one state or theother. For read only memory, a cyclical redundancy check (CRC) isperformed. Following these processor hardware start-up tests, eachprocessor begins its normal program execution.

After the processor tests are completed in step 500, the system goesinto a disarmed state 502. The disarmed state monitors the arm buttons(either on the touch screen or on the remote control unit) to detect theactuation of the arm button. If the arm button is actuated, the systemexecutes a series of ECT hardware tests in step 504. If the arm buttonis not detected, the system performs a plurality of software tests. Eachof these tests is discussed below.

In the disarmed state 502, there are a number of software and hardwaresafety tests that are performed. These tests are performed continuouslywhile in this state. The first of these tests checks to see that thereare valid trace data being received from the patient. If any of thepatient monitoring signals saturate and remain there for a predeterminedamount of time (e.g., one second), the system processor restores thetrace by asserting the TRACE₋₋ RESTORE signal (FIG. 3). The safetyprocessor also repetitively verifies that the hardware (HW), gated,ten-second, treatment duration timer is functional. The safety processoraccomplishes this by allowing the hardware ten-second timer to expireand verifies that the TIMER EXPIRED signal is asserted. The safetyprocessor itself includes a software (SW) ten-second treatment timerwhose function is backed up by the hardware ten-second timer in theevent that the software timer fails. The software verifies this hardwaretimer by allowing the hardware timer to expire and then verifies thatthe SW timer reads 10 seconds. If the software timer reaches 11 secondswithout the HW timer expiring, the SW assumes a HW timer failure. If thesoftware fails to receive the hardware timer interrupt at the completionof this test, an error condition exists. The safety processor alsoincludes a general purpose timer that is used for a number of otherfunctions. This timer is also checked while in the disarmed state in thesame manner as the ten-second treatment timer.

The safety processor also checks the voltage level of the power supplyvoltages during this disarmed state. The safety processor samples the 33volt, the-5 volt, the -12 volt and the 18 volt supply voltages andensures that these voltages are within their specified tolerances. Ifnot, the safety processor indicates an error condition exists.(Moreover, hardware voltage monitoring circuits will hold the system andsafety processors in reset if the+5 volt or+12 supplies are out of theiracceptable ranges.)

As described above, the system includes the ability to detect faults inthe optional remote control unit. During this time, those tests are runto ensure the remote control unit is functioning properly.

If the arm button is actuated, the system will transition from thedisarmed state and perform a plurality of ECT hardware tests in step504. Each of these tests must be completed successfully in order to moveto an arm state 506. If any failures occur, an error message isdisplayed in step 508, the system is disarmed in step 510 and the systemreturns to the disarmed state 502. A list of these ECT hardware tests isgiven below in Table 1 and a description of each follows.

                  TABLE 1                                                         ______________________________________                                        ECT Hardware Test                                                             ______________________________________                                        1. 10,000 ohm static impedance test and calibration                           2. zero ohm static impedance test and calibration                             3. current calibration                                                        4. 300 ohm load delivery test                                                 5. zero ohm load delivery test                                                6. energy limit test                                                          7. hardware watchdog test                                                     8. pulse width limit test                                                     9. frequency limit test                                                       ______________________________________                                    

Before executing any of the hardware self-tests, the system measures thepatient impedance. If the patient impedance is outside an acceptablerange (e.g., 100Ω-5 KΩ) the system generates an error message andterminates the arming process. Otherwise, the hardware self-tests areperformed.

The first of these hardware self-tests is the 10,000 ohm staticimpedance test and calibration. During this test, the 10,000 ohminternal load is across the output circuit and the static impedance ofthis circuit is measured. The Z₋₋ PULSE produces an approximately 40micro amp signal at 768 Hz through the load so that the impedance can bemeasured. The measured static impedance indication must be greater thana predetermined value in order for this test to pass. If the measuredstatic impedance indication exceeds that value, the measured staticimpedance indication is saved as a 10,000 ohm calibration point.

The second test is similar to the first except that a zero ohm short isconnected in the output circuit. This is accomplished by shorting the10,000 ohm load with relay R2 (FIG. 11B). Once the zero load is switchedin, the static impedance is again measured. In this case, however, themeasured static impedance indication must be less than a predeterminedminimum value. If the measured static impedance indication exceeds thisminimum value, then an error condition exists. Otherwise, the measuredstatic impedance indication is saved as a zero ohm calibration point. Aspart of this test, the output current is read. Because the 40 microampcurrent produced by the Z₋₋ PULSE is insufficient to be recognized bythe safety processor, under normal conditions this will produce acurrent reading of zero. If there is a non-zero current value detected,however, the system saves this as a zero current calibration value,which can be used to compensate for any DC offset in the currentmeasurement circuit.

Next, the safety processor initiates an energy delivery test into theinternal 300 ohm load. This test verifies a successful delivery of apre-treatment ECT pulse train to the internal 300 ohm load. As part ofthis test, the safety processor reads the energy counter 392 (FIG. 11B)and compares the detected energy with the expected delivered energy. Ifthe measured energy is not within a predetermined tolerance of theestimated energy, then the test will fail. During this test, the dynamicimpedance measurement is also verified. Because the pre-treatment ECTpulses are being delivered into a known load, the dynamic impedanceshould be approximately equal to 300 ohms. If the measured dynamicimpedance is not within a predefined, acceptable range of this value,however, the test fails.

During the 300 ohm delivery test, the safety processor also verifies thesoftware pulse train duration timer. During this test, the safetyprocessor configures the system to generate a pulse train duration of acertain time, but then sets the software timer for less than thatspecified duration. Thus, the software should terminate the pulse trainwhen the timer expires, if the software duration monitor is functioningproperly. The safety processor then verifies that the treatment was infact stopped. If not, the safety processor indicates that a errorcondition exists and disarms the machine.

As part of the zero ohm impedance testing calibration, the safetyprocessor performs a zero ohm load delivery test. In this test, thesystem attempts to verify that the system properly terminates whendelivering into an internal zero ohm load.

In another aspect of this test sequence, the system processor performs aplurality of energy limit tests. In these tests, the safety processorattempts to verify that the energy detector and monitor circuits work asdesigned. The safety processor first switches the clock 2 signalprovided to the energy counters 392 (FIG. 11B) in order to acceleratethe rate of counting transitions of signal JOULE₋₋ CLK. Signal DIVIDER₋₋SELECT in FIG. 11B controls this acceleration, but acceleration isprevented during an actual ECT treatment. The processor then sets thenumber of pre-treatment pulses to be delivered equal to 10,000. Theprocessor then initiates a pre-treatment ECT pulse train into theinternal 300 ohm load and attempts to verify that a hardware shutdown(HW₋₋ SD) occurred at the level its software knows the hardware maxenergy limit select should be set. The safety processor verifies this byreading the ENERGY₋₋ MAX signal and the HW₋₋ SD signal. If not, theprocessor generates an error condition and disarms the circuit.

The safety processor itself also maintains a software energy limitcounter as a backup to the hardware energy counter. Usually, thesoftware energy limit counter is set above the hardware energy counterand, thus, trips only if the hardware counter fails. To test that thissoftware energy limit counter is functioning properly, the software setsthis internal software counter to a small value and again initiates apre-treatment ECT pulse train. The processor then verifies that thepulse train was shut down by software after the appropriate amount ofenergy was delivered. The safety processor monitors the delivered energyby either counting the number of pulses or by monitoring the deliveredvoltage and current. The safety processor includes a plurality of A-to-Dinputs for receiving these analog signals.

The system also includes a hardware watchdog test that is performedduring step 504. In this test, the safety processor remains idle for afixed period of time without retriggering the watchdog timer. After thisfixed period of time, the safety processor verifies that the watchdogtimer failed by reading the WD₋₋ FAILURE signal. The watchdog timer canthen be reset by clocking the timer.

The system also monitors the pulse width of each ECT pulse to ensurethat the pulse width is within a predetermined tolerance range of thespecified pulse width. The safety processor generates the pulses by theuse of two internal timers. The first timer sets the time between theleading and trailing edge of a pulse. The second timer specifies thetime between the leading edge of a first pulse to the leading edge of asubsequent edge. Thus, the first timer sets the pulse width and thesecond timer the period or, alternatively, the frequency. The safetyprocessor also monitors each edge of the resulting pulse and thenverifies that the resulting pulse width is as specified by the timervalues. In the preferred embodiment, each edge generates an interruptand further traps the value of a system timer or time stamp. Theinterrupt service routine then reads this time stamp and compares itwith the time stamp of the previous edge to determine the pulse width ofthe signal. The processor can also determine the period between pulsesor the frequency by comparing the time stamps of corresponding edges insubsequent pulses.

During this test, the safety processor verifies that this software pulsewidth monitor is functioning properly. It does this by setting thetimers to produce a pulse width of a certain time, yet checking for adifferent pulse width in the software monitoring routine. If functioningproperly, this should produce an error condition responsive to which thesafety processor will disable or terminate the ECT pulse train.

As described above, the hardware limits all pulses to a maximum pulsewidth of approximately 2.2 milliseconds. The software verifies that thislimiting feature is functioning properly by setting the timer values toproduce a pulse width in excess of this maximum allowable pulse width.The software then measures the pulse width of the delivered pulses andverifies that, in fact, they are being limited to the max 2.2millisecond pulse width. If the pulses are not being so limited, thesafety processor generates an error condition.

The system also performs a variety of frequency limit tests during thisbattery of hardware tests in step 504. There are two levels of frequencymonitoring: software and hardware. In the software monitor, thefrequency is measured on a pulse-by-pulse basis to determine whether ornot the frequency is within a predetermined range of the specifiedfrequency. On the hardware level, the hardware shuts down the ECT pulsesif the frequency exceeds a predetermined maximum pulse frequency. Bothof these are verified during the frequency limit test.

To test the software frequency monitor, the safety processor sets up apulse train at a first frequency, but then assumes the frequency to be adifferent frequency value. The software processor then checks thefrequency of each pulse by measuring the time between the correspondingedges of subsequent pulses (i.e., leading edge-to-leading edge ortrailing edge-to-trailing edge. If the measured frequency falls outsideof a specified range, as it should, the safety processor shuts down thepre-treatment ECT pulse train that is being delivered into the 300 ohminternal load. In this way, the safety processor can verify that itssoftware frequency monitor is functioning properly.

The safety processor also verifies that the hardware frequency monitoris functioning properly. It accomplishes this by setting up a pulsetrain having a frequency in excess of the maximum allowable frequency.In the preferred embodiment, this maximum allowable frequency isapproximately 220 Hz. The safety processor then configures the system todeliver this pulse train into the internal 300 ohm load and thenverifies that the hardware frequency monitor disabled the delivery ofthe pulse train in response to this excessive frequency.

If all of these hardware self-tests are performed without error, thesystem enters the armed state 506. While in the armed state, the systemcontinuously monitors patient impedance and checks to see that allpatient monitoring leads are connected to the patient. If either ofthese two conditions are not met, the system disarms and displays anappropriate error message.

If, in the armed state 506, the system detects that the treatment buttonhas been pressed, the system begins applying the actual ECT treatmentpulse train in step 508. The parameters of the ECT treatment pulse trainare those specified by the user via the front panel. These parametersinclude current, pulse width, frequency and duration. Unlike prior artECT systems, the system according to the invention monitors each ofthese parameters during the treatment and terminates the treatment ifany one of these parameters, as well as others, deviate from specifiedor predetermined values of these parameters. This avoids harm to thepatient in the event that the failure occurs during an actual treatment.

The system performs several tests during treatment to detect any ofthese failure conditions. A list of these tests is given below in Table2.

                  TABLE 2                                                         ______________________________________                                        Tests Performed During Treatment                                              ______________________________________                                                  1. maximum energy test                                                        2. average current test                                                       3. relay test                                                                 4. pulse width test                                                           5. frequency test                                                             6. voltage test                                                               7. current test                                                               8. pulse count test                                                           9. duration test                                                    ______________________________________                                    

The first three tests listed above are actually performed upon enteringthe armed state, but prior to actual treatment. The maximum energy testensures that the energy level of the specified ECT treatment does notexceed the allowed regulatory energy limit. The energy level iscalculated based on the parameter settings and an assumed standardpatient impedance.

The average current test ensures that the average current of therequested ECT treatment does not exceed the maximum average currentdelivered by the system.

The relay control settings are also tested to ensure that the relays areproperly configured. The system does this by reading the output signallevel of DAC 414. This test is also performed any time the relaysettings are changed.

The remaining tests are performed after the treatment has begun.Moreover, several of the tests (4-8) are performed on a pulse-by-pulsebasis. The pulse width is measured by software by dating the time stampsthat are trapped by the system processor upon detection of the trailingand leading edges of each pulse. The pulse width is then determined bysimply subtracting the time stamp of the leading edge from that of thetrailing edge. This detected pulse width is then compared with thespecified pulse width, as set on the front panel, to determine whetherthe measured pulse width is within an acceptable tolerance of thespecified pulse width. If the pulse width falls outside of that range,the safety processor terminates the treatment.

Similarly, the safety processor measures the frequency of the pulsetrain on a pulse-by-pulse or, rather, period-by-period basis. It doesthis by subtracting the time stamp of a leading edge of a pulse from atime stamp of a leading edge of the subsequent pulse to determine theperiod of that pulse. This detected period is then compared with thereciprocal of the specified frequency to determine whether the measuredfrequency is within an acceptable tolerance or range of the specifiedfrequency. If not, the treatment is terminated.

The safety processor also monitors the voltage and current of each pulseand compares these measured values to those specified by the user. Ifthis measured current is not within a predetermined range of thespecified value, the processor terminates the treatment. The voltage onthe other hand must be less than a predetermined maximum voltage. Asdescribed above, the safety processor included one or more A-to-D inputsthat are used to sample the signal levels of these signals (e.g.,DELIV₋₋ I, DELIV₋₋ V, etc.).

The safety processor also maintains a Count of the number of deliveredpulses and the number of measured pulses to ensure that the safetyprocessor is not falling behind and is, in fact, processing each pulseas it occurs. If the safety processor falls behind, i.e., deliveredpulse count is greater than the measured pulse count, the safetyprocessor assumes that it has become overloaded and therefore terminatesthe treatment as well.

During the ECT treatment, the software keeps retriggering the watchdogtimer. If this watchdog times out, the ECT hardware terminates thetreatment.

Finally, if the operator prematurely terminates the treatment, the ECThardware terminates the treatment and notifies the safety processor.

If any fault or error occurs during the stimulus, the system in additionto terminating the stimulus, generates an error message in step 512,which logs the source of the faults. The system then enters a faultstate 514 and waits there until the view results button is pushed on thefront panel. The view results button causes the recorder to stoprecording patient monitoring waveforms in 516 and, further, displays theerror message to the user. Following this, the system is disarmed instep 518 and returns to the disarm state 502.

B. OPTICAL MOTION SENSOR

In another aspect of the invention, a non-invasive, optical sensor isused to detect seizure-induced patient motion. As is known in the art ofECT, the primary benefit of ECT is produced by induced seizures. It istherefore important for the clinician to monitor the level of inducedseizure of the patient.

Shown in FIG. 15 is the preferred method of monitoring a patient seizureactivity. In FIG. 15, an optical detector 528 is mounted on a patient'sdigit 530 about the knuckle. The knuckle area is chosen because theeffects of blood flow on the measurement is minimized. Furthermore, therelative magnitude of the patient's heartbeat signal detected isminimized when the detector is mounted on the "nail" side of theknuckle, and the signal proportional to knuckle flexing maximized.

The optical detector includes a light-emitting diode 532 and an opticaldetector such as a photoresistor 534. The light-emitting diode 532 emitslight that is reflected off of the knuckle and detected by photoresistor534. The photoresistor 534 then produces a patient monitoring signal OMSthat is proportional to the intensity of the light received thereby. A3.6 volt supply voltage (3.6 V) is applied to the LED 532 to providepower thereto. An ECT-induced seizure will be manifest by twitchingflexions of the knuckle. This changes the amount of light received bythe detector 534 responsive to the expansion and contraction of themuscle under the surface. Thus, the optical detector 528 can effectivelybe used to monitor ECT-induced seizure activity.

Typically, a muscle relaxant is applied to the patient prior to an ECTtreatment. In order for the optical motion sensor to work properly, theclinician must prevent the muscle relaxant from affecting the digit onwhich the sensor is located. One way to accomplish this is to constrictthe user's appendage to which the digit 530 is connected so as to limitthe blood flow, and therefore the muscle relaxant, to the digit. Asimple blood pressure cuff can be used to accomplish this, when inflatedto a pressure above the patient's systolic blood pressure.

Having described and illustrated the principles of the invention in apreferred embodiment thereof, it should be apparent that the inventioncan be modified in arrangement and detail without departing from suchprinciples. I claim all modifications and variation coming within thespirit and scope of the following claims.

We claim:
 1. A method of ensuring the safety of a patient duringelectro-convulsive therapy (ECT) by automatic self test and operation ofECT apparatus, the method comprising:applying a pre-treatment pulsetrain to a dummy load including a plurality of individual pre-treatmentpulses, each pre-treatment pulse having pulse parameters that define thepulse, the pulse parameters defining a set of pulse train parameters;measuring a pulse train parameter of the pre-treatment pulse trainacross the dummy load; and applying a treatment pulse train to thepatient only if the measured pulse train parameter satisfies apredetermined criteria; and disabling the apparatus from applying thetreatment pulse train to the patient if the measured pulse trainparameter fails the predetermined criteria.
 2. A method of ensuring thesafety of a patient during electro-convulsive therapy (ECT) according toclaim 1 wherein the step of measuring a pulse train parameter includesthe step of measuring a pulse width of a pre-treatment pulse.
 3. Amethod of ensuring the safety of a patient during electro-convulsivetherapy (ECT) according to claim 1 wherein the step of measuring a pulsetrain parameter includes the step of measuring a frequency of thepre-treatment pulse train.
 4. A method of ensuring the safety of apatient during electro-convulsive therapy (ECT) according to claim 1wherein the step of measuring a pulse train parameter includes the stepof measuring a duration of the pre-treatment pulse train.
 5. A method ofensuring the safety of a patient during electro-convulsive therapy (ECT)according to claim 1 wherein the step of measuring a pulse trainparameter includes the step of measuring a power of the pre-treatmentpulses.
 6. A method of ensuring the safety of a patient duringelectro-convulsive therapy (ECT) according to claim 5 wherein the stepof measuring a power of pre-treatment pulses includes:measuring avoltage of a pre-treatment pulse; measuring a current of thepre-treatment pulse; and multiplying the measured current and themeasured voltage to produce the measured power.
 7. A method of ensuringthe safety of a patient during electro-convulsive therapy (ECT)according to claim 6 wherein the step of measuring a pulse trainparameter includes the step of measuring an energy of the pre-treatmentpulse train.
 8. A method of ensuring the safety of a patient duringelectro-convulsive therapy (ECT) according to claim 7 wherein the stepof measuring an energy of the pre-treatment pulse train includesintegrating the measured power.
 9. A method of ensuring the safety of apatient during electro-convulsive therapy (ECT) according to claim 8wherein the step of integrating the measured power includes:convertingthe measured power to a power signal having a frequency proportional tothe measured power; and incrementing a counter by the power signal toproduce a count signal that is proportional to the measured energy. 10.A method of ensuring the safety of a patient during electro-convulsivetherapy (ECT) according to claim 1 further comprising:applying a trainof treatment pulses to a patient; measuring a pulse train parameter ofthe treatment pulse train applied to the patient; and terminating thetreatment pulse train if the measured pulse train parameter of thetreatment pulse train fails to satisfy a predetermined criteria.
 11. Amethod of ensuring the safety of a patient during electro-convulsivetherapy (ECT) according to claim 10 wherein the step of measuring apulse train parameter includes the step of measuring a pulse width ofthe treatment pulses.
 12. A method according to claim 10 in which eachtreatment pulse has a pulse width, the elapsed time of the pulse traindefines a pulse train duration, and the time between adjacent pulsesdefines a frequency of the treatment pulse train;the measuring stepincludes a pulse width detection step that measures the pulse width ofeach applied ECT treatment pulse; and the terminating step includes apulse width monitoring step responsive to the pulse width to ceaseapplying the treatment pulses to the patient if a measured pulse widthexceeds a predetermined maximum pulse width.
 13. A method according toclaim 10 in which each treatment pulse has a pulse width, the elapsedtime of the pulse train defines a pulse train duration, and the timebetween adjacent pulses defines a frequency of the treatment pulsetrain;the measuring step includes a pulse train duration detection stepthat measures the duration of the applied ECT treatment pulse train; andthe terminating step includes a pulse train duration monitoring stepresponsive to the pulse train duration to cease applying the treatmentpulses to the patient if the measured pulse train duration exceeds amaximum pulse train duration.
 14. A method according to claim 10 inwhich each treatment pulse has a pulse width, the elapsed time of thepulse train defines a pulse train duration, and the time betweenadjacent pulses defines a frequency of the treatment pulse train;themeasuring step includes a pulse train energy detection step thatmeasures the energy in the applied ECT treatment pulse train; and theterminating step includes a pulse train energy monitoring stepresponsive to the pulse train energy to cease applying the treatmentpulses to the patient if the measured pulse train energy exceeds apredetermined limit.
 15. A method according claim 14 wherein the step ofpulse train energy detection includes:a power detection step thatgenerates a power signal having a signal level corresponding to thepower of each applied ECT treatment pulse; and an integration stepreceiving the power signal and generating an energy signal correspondingto the level of energy of the applied ECT treatment pulse train.